package com.wyc.service;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;

public class collec {

    public static void main(String[] args) {
        //hashset
        HashSet sets = new HashSet();
        sets.add("test");
        sets.add("test1");
        Iterator it = sets.iterator();
        while (it.hasNext()){
            System.out.println(it.next().toString());
        }

        //hashmap
        HashMap map = new HashMap();
        map.put("1","2");
        map.put("1","2");
        Iterator it1 = map.keySet().iterator();
        while (it1.hasNext()){
            System.out.println(map.get(it1.next()));
        }
    }
}
